function is_even {
    local num=$1
    if (( num % 2 == 0 )); then
        return 0  # Success, number is even
    else
        return 1  # Failure, number is odd
    fi
}
is_even 4
result=$?
if [ $result -eq 0 ]; then
    echo "Number is even."
else
    echo "Number is odd."
fi
